/****************************************
 * 2018 - 2021 版权所有 CopyRight(c) 快程乐码信息科技有限公司所有, 未经授权，不得复制、转发
 */

package com.kclm.security03.modules.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kclm.security03.modules.system.entity.Permission;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;
import java.util.List;

/******************
 * @Author yejf
 * @Version v1.0
 * @Create 2020-07-24 17:29
 * @Description 权限操作DAO接口
 */
public interface PermissionMapper extends BaseMapper<Permission> {

    //如果想自定义方法，也可以直接写sql语句

    @Select(value = "select p.* from t_sys_user u  join t_sys_user_role ur on u.id = ur.user_id join t_sys_role r on ur.role_id = r.id join t_sys_role_permission rp on r.id = rp.role_id join t_sys_permission p on rp.permission_id = p.id where u.id = #{value}")
    List<Permission> selectByUserId(Serializable userId);

}
